home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 6639 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  980 b 

  1. Path: news.mira.net.au!news
  2. From: davidw@werple.net.au (David White)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Why use a reference on a ptr foo(int &*parm) as a formal parm ?
  5. Date: 12 Feb 1996 20:31:27 +1100
  6. Organization: Werple Internet, Melbourne
  7. Message-ID: <4fn1df$n7u@werple.net.au>
  8. References: <311DC7A8.2A1C@worldcom.ch>
  9. NNTP-Posting-Host: werple.mira.net.au
  10.  
  11. Jean-Pierre Schnyder <jschnyde@worldcom.ch> writes:
  12.  
  13. >Hi,
  14.  
  15. >I'm not sure to understand the rationale for this technique. Any idea ?
  16.  
  17. >I'd appreciate if you emailed me the answer !
  18.  
  19. There is no rationale for it because a pointer to a reference is illegal. 
  20. I suppose you meant 'int *&parm', in which case it is used so the 
  21. function can change the value of the referenced pointer. It is just a 
  22. cleaner syntax than the alternative, a pointer to a pointer, although it 
  23. is not obvious where the call is made that the function is able to change 
  24. the value of the passed pointer.
  25.  
  26. David White
  27. davidw@werple.mira.net.au
  28.  
  29.